package com.order.controller;

import com.order.pojo.OrderList;
import com.order.service.OrderListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("orderList")
public class OrderListController {
    @Autowired
    private OrderListService orderListService;
    @RequestMapping("order")
    @ResponseBody
    public Integer order(OrderList order) {
        return orderListService.order(order);
    }

    @RequestMapping("quit")
    @ResponseBody
    public Boolean quit(Integer id) {
        return orderListService.quit(id);
    }

    @RequestMapping("sum")
    @ResponseBody
    public Double sumPrice(Integer order_id) {
        return orderListService.sumPrice(order_id);
    }
}
